package com.quanyue.music.file.mapper;

import com.quanyue.music.domain.entity.FmNames;
import com.shzisg.mybatis.mapper.auto.AutoMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FMNamesMapper extends AutoMapper<FmNames> {

    @Select("select * from qy_fm_names f where f.fm_id = #{fmId} order by f.seconds")
    List<FmNames> findByFmId(@Param("fmId") String fmId);

    @Select("select f.fm_name from qy_fm_names f where f.fm_id = #{fmId} order by f.seconds")
    List<String> findNamesByFmId(@Param("fmId") String fmId);

    @Delete("delete from qy_fm_names where fm_id = #{fmId}")
    void deleteByFmId(@Param("fmId") String fmId);
}
